package qlexpression;

import com.google.common.base.Charsets;
import com.google.common.base.Joiner;
import com.google.common.io.Files;
import com.ql.util.express.DefaultContext;
import com.ql.util.express.ExpressRunner;

import java.io.File;

/**
 * Created by donar on 17/12/11.
 */
public class Demo {
    public static void main(String[] args) throws Exception {
//        TradeInfo tradeInfo  = new TradeInfo();
//        Address addres = new Address();
//        addres.setPhone("1111");
//        tradeInfo.setAddress(addres);
//        tradeInfo.setTid("sdasjdoiasl");
//
//
//        ExpressRunner runner = new ExpressRunner();
//        DefaultContext<String, Object> context = new DefaultContext<String, Object>();
//        context.put("trade",tradeInfo);
//        System.out.println(tradeInfo);
//        String expression = Joiner.on("\n").join(Files.readLines(new File(Demo.class.getClassLoader().getResource("expression.java").getPath()), Charsets.UTF_8));
//        TradeInfo r = (TradeInfo) runner.execute(expression,context,null,true,false);
//        System.out.println(r.tid);
//        System.out.println(r.address.country);
//        //System.out.println(r.address.country);




    }


}

